<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html>
<head>
    <%@include file="/include/head.jsp"%>
    <title>常用体检人详情</title>
    <link type="text/css" rel="stylesheet" href="${rootPath}/static/css/ContactsDetail.css" />
    <script type="text/javascript">
        function updateUserExaminationPopulation(type) {
            var url;
            if (type == 0) url = "${rootPath}/customer/account/insert/contactsDetail.do";
            else url = "${rootPath}/customer/account/update/contactsDetail.do";
            $.ajax({
                cache: true,
                type: "POST",
                dataType: "json",
                url:url,
                data:$('#insert_user_population_form').serialize(),// 你的formid
                async: true,
                error: function(request) {
                    layer.open({
                        skin:"msg",
                        content:"服务器连接失败!",
                        time: 1.5
                    })
                },
                success: function(data) {
                    if (data.success) {
                        layer.open({
                            skin:"msg",
                            content:data.msg,
                            time: 1.5
                        })
                        window.location.href = "${rootPath}/customer/account/contacts.do";
                    } else {
                        layer.open({
                            skin:"msg",
                            content:data.msg,
                            time: 1.5
                        })
                    }
                }
            });
        }
    </script>
</head>
<body>
<header class="mui-bar mui-bar-nav qy-bg-white qy-border-bottom">
    <a class="mui-icon mui-icon-back qy-text-black" href="${rootPath}/customer/account/contacts.do"></a>
    <h1 class="mui-title qy-text-black qy-font-size-20px">{{title}}</h1>
</header>
<nav class="mui-bar mui-bar-tab qy-bg-blue qy-border-top">
    <span onclick="updateUserExaminationPopulation(${type})" class="qy-block qy-font-size-18px qy-text-center qy-text-white qy-full-height qy-font-lineHeight-30px">保存</span>
</nav>


<div class="mui-content qy-margin-top-4px">
    <form id="insert_user_population_form">
        <div class="mui-row qy-bg-white qy-font-size-18px qy-text-gray">
            <div class="mui-col-xs-12">
                <div class="mui-input-row">
                    <label>姓名：</label>
                    <input hidden name="id" value="${population.id}"/>
                    <input hidden name="userId" value="${population.userId}"/>
                    <input value="${population.name}" name="name" type="text" class="mui-input-clear" placeholder="请输入姓名" maxlength="14" />
                </div>
            </div>
        </div>
        <div class="mui-row qy-bg-white qy-font-size-18px qy-text-gray qy-margin-top-8px">
            <div class="mui-col-xs-12 qy-padding-left-12px">
                <div class="mui-input-row qy-border-bottom">
                    <label class="qy-no-padding-vertical">手机号码：</label>
                    <input value="${population.phone}" name="phone" type="text" class="mui-input-clear" placeholder="请输入手机号码">
                </div>
                <div class="mui-input-row">
                    <label class="qy-no-padding-vertical">身份证：</label>
                    <input value="${population.identity}" name="identity" type="text" class="mui-input-clear" maxlength="18" placeholder="请输入身份证">
                </div>
            </div>
        </div>
        <div class="mui-row qy-bg-white qy-font-size-18px qy-text-gray qy-margin-top-8px">
            <div class="mui-col-xs-12 qy-padding-left-12px">
                <div class="mui-input-row qy-border-bottom">
                    <label class="qy-no-padding-vertical">性别：</label>
                    <div class="mui-input-row mui-radio mui-left qy-no-clear qy-fl">
                        <label class="qy-padding-left-30px qy-width-auto">男</label>
                        <c:if test="${population.sex == '0'}">
                            <input checked="checked" name="sex" value="0" type="radio">
                        </c:if>
                        <c:if test="${population.sex != '0'}">
                            <input name="sex" value="0" type="radio">
                        </c:if>
                    </div>
                    <div class="mui-input-row mui-radio mui-left qy-no-clear qy-fl qy-margin-left-16px">
                        <label class="qy-padding-left-30px qy-width-auto">女</label>
                        <c:if test="${population.sex == '1'}">
                            <input checked="checked" name="sex" value="1" type="radio">
                        </c:if>
                        <c:if test="${population.sex != '1'}">
                            <input name="sex" value="1" type="radio">
                        </c:if>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

</body>
</html>
<script type="text/javascript" charset="utf-8" src="${rootPath}/static/js/ContactsDetail.js"></script>